home *** CD-ROM | disk | FTP | other *** search
/ Belgian Amiga Club - ADF Collection / BS1 part 05.zip / BS1 part 5 / ANC_UTULITYS_16.adf / arclist / asm1.arc / CREAT.PIC.S < prev    next >
Text File  |  1988-09-21  |  2KB  |  73 lines

  1. **********************************************************************
  2. **                  HOW TO SHOW A PICTURE IN ASSEMBLER              **
  3. **********************************************************************
  4.  
  5. s:
  6. move.l    #coplist,$dff080        ; Pointer to copperlist
  7.  
  8. ****************** FILL PICTURE WITH LINES *****************
  9.  
  10. move.l    #$60000,a0            ; Picture is here
  11. move.l    #$1f40,d0            ; Number of bytes large
  12. ClearLoop:
  13. move.b    #$ac,(a0)+            ; Store $ac in memory and
  14.                     ; add 1 to a0.
  15. dbf    d0,ClearLoop            ; Subtract 1 from D0, if not
  16.                     ; -1 then jump to 'ClearLoop'
  17.  
  18. WaitMouse:
  19. btst    #6,$bfe001
  20. bne.s    WaitMouse            ; Wait for mouse button
  21.  
  22. move.l    4,a6                ; AbsExecBase
  23. move.l    #0,d0                ; Take any version of graphlib
  24. move.l    #GraphLib,a1            ;Pointer to "graphics.library"
  25. jsr    -552(a6)            ; OpenLibrary
  26.  
  27. move.l    d0,a0                ; Start address of library
  28. move.l    $26(a0),$dff080            ; WB Screen copper pointer is
  29.                     ; in Start address+$26.
  30. move.l    #0,d0                ; Tells CLI we are OK.
  31. rts
  32.  
  33. GraphLib:dc "graphics.library",0    ; Tell computer what library
  34.                     ; we want to open.
  35.  
  36. even                    ; Copperlist must be at an
  37.                     ; EVEN address
  38.  
  39. CopList:                ; Copper list starts here
  40.  
  41. dc.w    $0180,$0000            ; $0180=0 (Background color)
  42. dc.w    $0182,$0fff            ; $0182=$fff (Color 1)
  43.  
  44. dc.w    $0100,$1200            ; $0100=$1200, Use 1 Bitplane
  45.                     ; LOW-RES.
  46. dc.w    $00e0,$0006
  47. dc.w    $00e2,$0000            ; First BitPlane is at $60000
  48.  
  49. dc.w    $008e,$2c81            ; Upper left corner of display
  50. ;   Upper Edge ^^ ^^ Left edge ($81)
  51. dc.w    $0090,$f4c1            ;Lower right corner of display
  52. ;   Lower edge ^^ ^^ Right edge ($c1)
  53.  
  54. dc.w    $0092,$0038            ; Should be this way
  55. dc.w    $0094,$00d0            ; if 320x200 display.
  56.  
  57. dc.w    $0108,$0000            ; Skip 0 bytes after
  58.                     ; a picture line has been
  59.                     ; drawn.
  60.  
  61. dc.w    $0102,$0000            ; No shift (scroll)
  62.  
  63. dc.w    $0120,$0000,$0122,$0000        ; Turn off sprite 0
  64. dc.w    $0124,$0000,$0126,$0000        ; Turn off sprite 0
  65. dc.w    $0128,$0000,$012a,$0000        ; Turn off sprite 0
  66. dc.w    $012c,$0000,$012e,$0000        ; Turn off sprite 0
  67. dc.w    $0130,$0000,$0132,$0000        ; Turn off sprite 0
  68. dc.w    $0134,$0000,$0136,$0000        ; Turn off sprite 0
  69. dc.w    $0138,$0000,$013a,$0000        ; Turn off sprite 0
  70. dc.w    $013c,$0000,$013e,$0000        ; Turn off sprite 0
  71.  
  72. dc.w    $ffff,$fffe            ; End of copperlist
  73.